
<#include "/common/head.html"/>


 <div class="easyui-panel addPage" data-options="fit:true,border:false,novalidate:true">
    <form class="easyui-form" id="ff" method="post" data-options="novalidate:true">
        <table class="table1">
            <tr>
           		<th><span id="userlevel_label">会员等级：</span></th>
               	<td>
	            	<div class="wrap_input"><input class="easyui-combobox" id="userlevel" name="userlevel" value="" data-options="
	            				valueField: 'id',
   								textField: 'text',
   								fit: true,
	            				data: [
	            					{id:'', text:''}<#list dictDatauserlevel.keySet() as key>,{id:'${key}', text:'${dictDatauserlevel.get(key)}'}</#list>
	            				]
	            				,required:true
	            	" /></div>        	
           		</td>
            <tr>
           		<th><span id="enter_times_label">可抽奖次数（0为不限）：</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-numberspinner" type="text" name="enter_times" id="enter_times" value="0" data-options="fit: true,required:true"></input></div>
           		</td>
            </tr>
            <tr>
           		<th><span id="goal_times_label">最大中奖次数（0为不限）：</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-numberspinner" type="text" name="goal_times" id="goal_times" value="0" data-options="fit: true,required:true"></input></div>
           		</td>
            </tr>
        </table>
    </form>
</div>
<script>

top.window.subPage.save = save;
function save() {
	if($("#ff").form('enableValidation').form('validate')) {
		$.post("add", getParam(), function(data) {
			if(data.result == "success") {
				top.window.closeWindow();
				top.window.subPage.loadCurrDatagrid();
			}
		});
	}
}
function getParam() {
	var param = {
        	"model.gameid": getQueryString('gameid'),
       		"model.userlevel": getInputValue("userlevel"), 
       		"model.enter_times": getInputValue("enter_times"), 
       		"model.goal_times": getInputValue("goal_times"), 
	}
	for(key in param) {
		if(!param[key]) {
			delete param[key];
		}
	}
	return param;
}

//扩展js
</script>
<#include "/common/foot.html"/>
